IsNotOfType(T) Method (ConditionValidator(T), Type)

CuttingEdge.Conditions

Checks whether the Type of the given value is not of type. An exception is thrown otherwise. When the given value is a null reference, the check will always pass, regardless of the specified type. Please use the IsNotNull method to check for null references).

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function IsNotOfType(Of T As Class) ( _
	validator As ConditionValidator(Of T), _
	type As Type _
) As ConditionValidator(Of T)
C#
public static ConditionValidator<T> IsNotOfType<T>(
	ConditionValidator<T> validator,
	Type type
)
where T : class
Visual C++
public:
generic<typename T>
where T : ref class
static ConditionValidator<T>^ IsNotOfType(
	ConditionValidator<T>^ validator, 
	Type^ type
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

validator
Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(T>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
type
Type: System..::.Type
The Type that will be used to perform the check.

Type Parameters

T
The type of the Value of the specified validator.

Return Value

The specified validator instance.

Exceptions

ExceptionCondition
System..::.ArgumentExceptionThrown when the Value of the specified validator is of the specified type, while the specified validator is created using the Requires extension method.
CuttingEdge.Conditions..::.PostconditionExceptionThrown when the Value of the specified validator is of the specified type, while the specified validator is created using the Ensures extension method.

See Also